/*
 * Copyright (c) 2017. 杭州端点网络科技有限公司.  All rights reserved.
 */

package com.jiantong.user.enums;

/**
 * @author : panxin
 */
public enum DepartmentUserType {

    ADMIN(1, "部门管理员"),
    NORMAL(2, "部门普通员工");

    private final int value;

    private final String description;

    DepartmentUserType(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public static DepartmentUserType from(int value) {
        for (DepartmentUserType ta : DepartmentUserType.values()) {
            if (ta.value == value) {
                return ta;
            }
        }
        throw new IllegalArgumentException("dept.user.type.undefined");
    }

    public int value() {
        return this.value;
    }


    @Override
    public String toString() {
        return description;
    }
}
